home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 125 / Computer Shopper CD-ROM Issue 125 (1998-07)(Dennis Publishing).iso / Business / Dazzler / DAZZLER.Z / CWindowAction.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-11-26  |  2.3 KB  |  85 lines

  1. import java.awt.Color;
  2. import java.awt.Dimension;
  3. import java.io.DataInputStream;
  4.  
  5. public class CWindowAction extends CDisplayAction {
  6.    static final int CHANGE_LAYER = 64;
  7.    static final int FULL_SCREEN_CENTRED = 128;
  8.    static final int OS_SIZE_AUTO = 1024;
  9.    static final int OS_SIZE_FIXED = 2048;
  10.    static final int BK_NONE = 65536;
  11.    static final int BK_COLOUR = 16;
  12.    static final int BK_FILE_CENTRE = 1048576;
  13.    static final int BK_GRADIENT_HORIZ = 4194304;
  14.    int m_nStyles = 0;
  15.    int m_nFlags = 0;
  16.    Dimension m_sizeOsBuffer = new Dimension();
  17.    Dimension m_sizeAutoScroll = new Dimension();
  18.    CByteArray m_byarrLockLayer = new CByteArray(11);
  19.    Color m_dwBkColour = new Color(255, 255, 255);
  20.    Color m_rgbFromColour = new Color(0, 255, 255);
  21.    Color m_rgbToColour = new Color(0, 0, 0);
  22.    CPicture m_Image = new CPicture();
  23.  
  24.    boolean DoAction() {
  25.       boolean var1 = false;
  26.       if (!Globals.thePresView.IsStopped()) {
  27.          if ((this.m_nFlags & 16) != 0 && Globals.thePresView.SetOffScreenBufferBkColour(this.m_dwBkColour)) {
  28.             var1 = true;
  29.          }
  30.  
  31.          if ((this.m_nFlags & 128) != 0 && Globals.thePresView.ResizeWindow(((CDisplayAction)this).GetActualRect().width, ((CDisplayAction)this).GetActualRect().height)) {
  32.             var1 = true;
  33.          }
  34.  
  35.          Globals.thePresView.SetCurrentWindowAction(this);
  36.          if (var1) {
  37.             Globals.thePresView.InvalidateOffScreenRect((CRect)null);
  38.             Globals.thePresView.RenderAndDrawDirtyList();
  39.          }
  40.       }
  41.  
  42.       return true;
  43.    }
  44.  
  45.    boolean LoadFromFile(DataInputStream var1) {
  46.       this.m_nStyles = FileLoad.ReadCPlusInt(var1);
  47.       this.m_dwBkColour = FileLoad.ReadColor(var1);
  48.       FileLoad.ReadCString(var1);
  49.       this.m_sizeOsBuffer.width = FileLoad.ReadCPlusInt(var1);
  50.       this.m_sizeOsBuffer.height = FileLoad.ReadCPlusInt(var1);
  51.       this.m_sizeAutoScroll.width = FileLoad.ReadCPlusInt(var1);
  52.       this.m_sizeAutoScroll.height = FileLoad.ReadCPlusInt(var1);
  53.       this.m_nFlags = FileLoad.ReadCPlusInt(var1);
  54.       if (Globals.CUR_COURSE.m_nFileVersion > 3) {
  55.          this.m_rgbFromColour = FileLoad.ReadColor(var1);
  56.          this.m_rgbToColour = FileLoad.ReadColor(var1);
  57.          this.m_Image.LoadFromFile(var1);
  58.       } else {
  59.          this.m_nFlags |= 5242880;
  60.          if ((this.m_nStyles & 16) != 0) {
  61.             this.m_nFlags |= 16;
  62.          } else {
  63.             this.m_nFlags |= 65536;
  64.          }
  65.       }
  66.  
  67.       if ((this.m_nFlags & 64) != 0) {
  68.          this.m_byarrLockLayer.LoadFromFile(var1);
  69.       } else {
  70.          CByteArray var2 = new CByteArray();
  71.          var2.LoadFromFile(var1);
  72.       }
  73.  
  74.       return super.LoadFromFile(var1);
  75.    }
  76.  
  77.    boolean IsLayerLocked(short var1) {
  78.       return var1 < this.m_byarrLockLayer.GetSize() && this.m_byarrLockLayer.GetAt(var1) != 0;
  79.    }
  80.  
  81.    public CWindowAction() {
  82.       super(9);
  83.    }
  84. }
  85.